import {Injectable} from '@angular/core';
import {HttpService} from '../../../core/http.service';
import {CommHttpService} from '../../../core/comm.http.service';
import {SERVERS_NAME} from '../../../config/config';
import {Observable} from 'rxjs';

@Injectable()
export class QuestionbankService extends CommHttpService {
    protected preUrl = `${SERVERS_NAME.EVALUTE_SERVER}base/questionItem/`; // 题库
    protected breUrl = `${SERVERS_NAME.EVALUTE_SERVER}base/questionClassify/`; // 题库类

    constructor(protected http: HttpService) {
        super(http);
    }

    /**********接口部分**********/

    /**
     * 新增题库分类
     */
    fycreate(param: any): Observable<any> {
        return this.http.post(param, this.breUrl + 'create');
    }

    /**
     * 删除题库分类
     */
    fydelete(param: any): Observable<any> {
      return this.http.post(param, this.breUrl + 'delete');
    }

    /**
     * 编辑题库分类
     */
    fyupdate(param: any): Observable<any> {
      return this.http.post(param, this.breUrl + 'update');
    }

    /**
     * 查询所有题库分类
     */
    fyfindAll(data): Observable<any> {
      return this.http.post(data, this.breUrl + 'findAll');
    }

    /*******获取分类树结构******/
    typeTree(): Observable<any> {
      return this.http.post({}, this.breUrl + 'tree');
    }

}
